package resume;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import util.dao.Pagination;



import com.opensymphony.xwork2.ActionSupport;

public class ResumeAction extends ActionSupport{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Resumej resumej;
	private ResumeDao resumeDao;
	private Pagination<Resumej> pagination;
	
	
	public Resumej getResumej() {
		return resumej;
	}
	public void setResumej(Resumej resumej) {
		this.resumej = resumej;
	}
	public ResumeDao getResumeDao() {
		return resumeDao;
	}
	public void setResumeDao(ResumeDao resumeDao) {
		this.resumeDao = resumeDao;
	}
	public Pagination<Resumej> getPagination() {
		return pagination;
	}
	public void setPagination(Pagination<Resumej> pagination) {
		this.pagination = pagination;
	}
	
	public ResumeAction() {
		this.pagination = new Pagination<Resumej>();
		this.pagination.setSize(5);
		this.pagination.setNo(1);
	}
	@Transactional(propagation=Propagation.SUPPORTS)
	public String login() throws Exception{
		return SUCCESS;
		
	}

	public String saveorupdate() throws Exception{
		resumeDao.saveOrUpdate(resumej);
		return SUCCESS;
	}
	
	
	public String delete() throws Exception{
		resumeDao.delete(resumej);
		return SUCCESS;
	}
	
	public String browse() throws Exception{
		resumeDao.browse(pagination);
		return SUCCESS;
	}
}
